package com.robot.backend.controller.user;

import cn.dev33.satoken.stp.StpUtil;
import com.alibaba.fastjson2.JSONObject;
import com.robot.backend.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.robot.backend.service.user.userInfoService;
import java.util.Map;

@RestController
@RequestMapping("/userInfo/")
public class userInfoController {
    @Autowired
    userInfoService userInfoService;

    @PostMapping("infoGet/")
    String infoGet(@RequestParam Map<String,String> map){
        return userInfoService.userInfoGet();
    }
    @PostMapping("infoUpdate/")
    String infoUpdate(@RequestParam Map<String,String> map){
        return userInfoService.userInfoUpdate(map.get("name"),map.get("photo"));
    }
    @PostMapping("tokenInfo/")
    String tokenInfo(@RequestParam Map<String,String> map){
        return userInfoService.tokenInfo();
    }
    @PostMapping("allRank/")
    JSONObject allRank(@RequestParam Map<String,String> map){
        return userInfoService.userRank(Integer.parseInt(map.get("page")),Integer.parseInt(map.get("size")));
    }
}
